package com.oocl.homework0711.parse;



public class Parse {
	public String[] parseCommand(String s){
		String[] command = new String[2];
		String[] strings = s.split("[\\s\\t]+");
			if(strings[0].equals("L")||strings[0].equals("l")){
				if(strings[1].equals("id")||strings[1].equals("ID")||strings[1].equals("ID")||strings[1].equals("iD"))
					command[0]="id";
				else if(strings[1].equals("birthday")||strings[1].equals("BIRTHDAY"))
					command[0]="birthday";
				else {
					return null;
				}
				if(strings[2].equals("xml")||strings[2].equals("XML"))
					command[1]="xml";
				else if(strings[2].equals("line")||strings[2].equals("LINE"))
					command[1]="line";
				else {
					return null;
				}
			}else if(strings[0].equals("Q")||strings[0].equals("q")){
				command[0]="quit";
				command[1]="quit";
			}else{
				return null;
			}
			return command;
		}
}
